{% extends 'common/basic_list.html' %}

{% block list_title %}
    作业状态
{% endblock %}

{% block list_filter %}
    <div class="col-sm-4">
        <div class="input-group">
            <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i> 搜索</button>
            &nbsp;
            <a href="task_state_add/"
               class="btn btn-sm btn-success"><i class="fa fa-plus"></i> 新增</a>
            &nbsp;
            <a href="javascript:void(0)"
               onclick="deleteBatch()"
               class="btn btn-sm btn-danger"><i class="fa fa-trash"></i> 批量删除</a>
        </div>
    </div>
{% endblock %}

{% block list_content %}
    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
        <thead>
        <tr>
            <th style="width: 2%;"><input id="checkall" type="checkbox" class="i-checks"></th>
            <th style="width: 10%;">任务名称</th>
            <th style="width: 10%;">状态</th>
            <th style="width: 10%;">状态id</th>
            <th style="width: 10%;">运行时间</th>
            <th style="width: 10%;">参数</th>
            <th style="width: 10%;">字典参数</th>
            <th style="width: 10%;">eta</th>
            <th style="width: 10%;">过期时间</th>
            <th style="width: 10%;">重试次数</th>
            <th style="width: 10%;">worker</th>
            <th style="width:10%;">操作</th>
        </tr>
        </thead>
        <tbody>
        {% for o in result_list %}
            <tr>
                <td>
                    <input type="checkbox" class="i-checks icheck" id="{{ o.id }}" name="input[]">
                </td>
                <td>{{ o.name }}</td>
                <td>{{ o.state }}</td>
                <td>{{ o.task_id }}</td>
                <td>{{ o.tstamp }}</td>
                <td>{{ o.args }}</td>
                <td>{{ o.kwargs }}</td>
                <td>{{ o.eta }}</td>
                <td>{{ o.expires }}</td>
                <td>{{ o.retries }}</td>
                <td>{{ o.worker }}</td>
                <td>
                    <a href="{{ o.id }}/task_state_edit/"
                       class="btn  btn-sm btn-info"><i class="fa fa-edit"></i>编辑</a>
                    <a href="javascript:void(0)"
                       onclick="deleteAction('{{ o.id }}')"
                       class="btn  btn-sm btn-danger"><i class="fa fa-trash"></i>删除</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}